#pragma once
#ifndef STUFF_H
#define STUFF_H

#include "headers.h"

#define UNKNOWN_CHAR -1
#define WRONG_SUFFIX_NEAR_DECIMAL -2
#define NO_DIGITS_AFTER_DOT -3
#define EXPONENT_HAS_NO_DIGITS -4
#define WRONG_SUFFIX_NEAR_EXPONENT -5
#define EMPTY_CHAR -6
#define MULTY_CHAR -7
#define UNEXPECTED_EOL -8
#define UNEXPECTED_EOF -9

//Error(0xfff, "Unknown characker found);
//Error(0xffe, "Wrong suffix near numeric literal);
//Error(0xffd, "Multiple dots in numeric literal");
//Error(0xffc, "No digits after dot in numeric literal");
//Error(0xffb, "Exponent has no digits");
//Error(0xffa, "Wrong suffix near exponent");
//Error(0xff9, "Unexpected dot in exponent");
//Error(0xff8, "Unexpected control sequense");
//Error(0xff7, "Empty character");
//Error(0xff6, "Multy symbols in char literal");
//Error(0xff5, "Unexpected end of line");
//Error(0xff4, "Unexpected end of file");
//Error(0xff3, "Unexpected symbol \'%1\' in state \'%2\'").arg(lex.value).arg(state));
//Error(0xff2, "Wrong cell value in action table", &lex);
//Error(0xff1, "Unexpected end of lexemes list");
//Error(0xff0, "Null pointer error");
//Error(0xfef, "Wrong state or symbol when adressing action table");

const QStringList KEYWORDS = QStringList() << "abstract" << "boolean" << "break" << "byte" << "case" << "catch" << "char" << "class" << "const" <<
                             "continue" << "default" << "do" << "double" << "else" << "extends"<< "false" << "final" << "finally" << "float" << "for" <<
                             "goto" << "if" << "implements" << "import" << "instanceof" << "int" << "interface" << "long" << "native" << "new" <<
                             "null" << "package" << "private" << "protected" << "public" << "return" << "short" << "static" << "super" << "switch" <<
                             "synchronized" << "this" << "throw" << "throws" << "transient"<< "true"  << "try" << "void" << "volatile" << "while";

struct Error
{
    int code;
    QString text;
    QObject* userValue;
    Error()
    {
        code=0;
        text="";
        userValue=NULL;
    }
    Error(int code, QString text, QObject* userValue=NULL)
    {
        this->code=code;
        this->text=text;
        this->userValue=userValue;
    }
    void Clear()
    {
        code=0;
        text="";
        userValue=NULL;
    }
};

struct Description
{
    Description(){}
    Description(QString type){this->type=type;}
    QString type;
    QObject* value;
    //description
    //type - done
    //value
    //isInitialezed;
};

typedef QMap<QPair<QString, int>, Description> MapWithPairKey;

#endif // STUFF_H
